package com.at.c09_method_area;

import java.io.Serializable;

/**
 * 测试方法区的内部构成
 *
 * javap -v -p MethodInnerStrucTest.class > test.txt
 *   -p 能反编译出 private 成员
 *
 * @author huangchao E-mail:fengquan8866@163.com
 * @version 创建时间：2024/7/12 17:37
 */
public class MethodInnerStrucTest extends Object implements Comparable<String>, Serializable {
    // 属性
    public int num = 10;
    private static String str = "测试方法的内部结构";

    // 构造器
    // 方法
    public void test1() {
        int count = 20;
        System.out.println("count = " + count);
    }

    public static int test2(int cal) {
        int result = 0;
        try {
            int value = 30;
            result = value / cal;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

    @Override
    public int compareTo(String o) {
        return 0;
    }
}
